import request from '@/utils/request'


//从配置中获取业务的地址
import {baseUrlConfig} from '@/config/config'
const basePath = baseUrlConfig.businessBaseUrl

//获取分页列表
export const devicePageList: (data: any) => Promise<[]> = (data) => {
    return request({
        url: basePath + '/resource/management/isolation/find/page',
        //url: bast + '/resource/management/isolation/find/page', 
        method: 'post',
        data
    })
}

//删除
export const deviceDeleteRow: (data: any) => Promise<[]> = (data: any) => {
    return request({
        url: basePath + "/resource/management/isolation/delete",
        // url: bast +'/resource/management/isolation/delete',
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        method: 'post',
        data
    })
}


//下载模板
export const deviceModuleDown = () => {
    return request({
        url: basePath + "/resource/management/isolation/download",
        // url: bast +'/resource/management/isolation/download',
        responseType: 'blob',
        method: 'post',
    })
}

//导入
export const deviceImport = (data:FormData) => {
    // console.log(data,777)
    return request({
        // url: bast + "/resource/management/isolation/import",
        url: basePath + '/resource/management/isolation/import',
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        method: 'post',
        data
    })
}

//导出当前页的数据
export const exportPageList: (data: any) => Promise<[]> = (data: any) => {
    return request({
        url: basePath + '/resource/management/isolation/export',
        method: 'post',
        responseType: 'blob',
        data
    })
}

// 增加
// @ts-ignore
export const append = (data) => {
    return request({
        url: basePath + '/resource/management/isolation/append',
        method: 'post',
        data
    })
}

// 编辑
// @ts-ignore
export const change = (data) => {
    return request({
        url: basePath + '/resource/management/isolation/change',
        method: 'post',
        data
    })
}

// 获取设备类型
export const geteqptType = (data: any) => {
    return request({
        url: basePath + '/eqpt/type/find',
        method: 'post',
        data
    })
}